home *** CD-ROM | disk | FTP | other *** search
- ;; init.lsp -- init XLisp global environment
- ;;
-
- (defun require (package)
- (unless (get package 'provided)
- (or (load (concatenate 'string (string-downcase package) ".ol"))
- (load (concatenate 'string (string-downcase package) ".l"))
- (load (concatenate 'string (string-downcase package) ".lsp"))
- (error "can't load package" package))
- ) )
-
- (defun provide (package)
- (setf (get package 'provided) t)
- )
-
-
- ; from 2.1almy...
- ; initialization file for XLISP 2.0
-
- (unless (fboundp 'strcat) ; backwards compatibility if COMMONLISP defined
- (defmacro strcat (&rest str) `(concatenate 'string ,@str)))
-
-
- ; define some macros
- (defmacro defvar (sym &optional val)
- `(if (boundp ',sym) ,sym (setq ,sym ,val)))
- (defmacro defparameter (sym val)
- `(setq ,sym ,val))
- (defmacro defconstant (sym val)
- `(setq ,sym ,val))
-
- ; (makunbound sym) - make a symbol value be unbound
- (defun makunbound (sym) (setf (symbol-value sym) '*unbound*) sym)
-
- ; (fmakunbound sym) - make a symbol function be unbound
- (defun fmakunbound (sym) (setf (symbol-function sym) '*unbound*) sym)
-
- ; (mapcan fun list [ list ]...)
- (defmacro mapcan (&rest args) `(apply #'nconc (mapcar ,@args)))
-
- ; (mapcon fun list [ list ]...)
- (defmacro mapcon (&rest args) `(apply #'nconc (maplist ,@args)))
-
- ; initialize to enable breaks and trace back
- (setq *breakenable* t)
- (setq *tracenable* nil)
- (alloc 50000)
-